<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>

<%
    String path = request.getContextPath();
    String basePath =
            request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
                    + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="shortcut icon" href="css/images/favicon.ico" type="image/x-icon"/>

    <title>房屋租赁系统</title>
    <base href="<%=basePath%>">
    <link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body style="background-image: url(css/images/bg_login.jpg)">
<div class="wrapper">

    <div class="container">
        <h1>房屋租赁管理系统</h1>
        <form class="form" id="loginform" action="logincheck.action" method="post">
            <div><input type="text" name="username" placeholder="用户名"></div>
            <div><input type="password" name="password" placeholder="密码"></div>

            <button type="submit" id="login-button">登&nbsp;&nbsp;&nbsp;&nbsp;录</button>
            <button type="button" id="regist-button"
                    onclick="window.location.href='toregist.action'">注&nbsp;&nbsp;&nbsp;&nbsp;册
            </button>
        </form>

    </div>

    <ul class="bg-bubbles">
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>

</div>

<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript"
        src="js/localization/messages_zh.js"></script>
<script type="text/javascript">

    $().ready(function () {
        // 在键盘按下并释放及提交后验证提交表单
        $("#loginform").validate({
            /*success:function(){
             //label.text('').addClass('valid');
            $('#login-button').click(function(event){
            event.preventDefault();
            $('form').fadeOut(500);
            $('.wrapper').addClass('form-success');

        });

        },*/
            rules: {
                username: {
                    required: true
                },
                password: {
                    required: true
                }
            },
            messages: {
                username: {
                    required: "请输入登录名"
                },
                password: {
                    required: "请输入登录密码"
                }
            }
        });
    });

    var code = "${code}";
    if (code == "0") {
        alert("${msg}");
    }
</script>


</body>
</html>